//
//  Omnipotence.js
//  SugLisSystem
//
//  Created by Mr.Right on 2013-05-12.
//  Copyright 2013 Mr.Right. All rights reserved.
//

var exeSQL = require('untils/ExeSQL');
function Omnipotence(LSPolSchema) {
	this.LSPolSchema = LSPolSchema;
	this.returnData = {};
	this.init();
	return this.returnData;
}

Omnipotence.prototype.init = function() {
	var strMidSql = "dataid , signno, Type, serialno,age,age+Degree-1,Value,protagonist,exponent,balance ,solidity,prevent";
	var strSignno = this.LSPolSchema['standbyflag3'];
	/** 用于存放查询时的所有sql语句 */
	sql = "select " + strMidSql + " from investriskdata t where type='0' and signno='" + strSignno + "' order by age";
	this.returnData.addPrem = exeSQL.execSQL(sql, exeSQL.TYPE_ARRAY);
	sql = "select " + strMidSql + " from investriskdata t where type='1' and signno='" + strSignno + "' order by age";
	this.returnData.partDraw = exeSQL.execSQL(sql, exeSQL.TYPE_ARRAY);
	sql = "select " + strMidSql + " from investriskdata t where type='2' and signno='" + strSignno + "' order by age";
	this.returnData.tackAmntChange = exeSQL.execSQL(sql, exeSQL.TYPE_ARRAY);
	sql = "select " + strMidSql + " from investriskdata t where type='3' and signno='" + strSignno + "' order by age";
	this.returnData.suFluityInvestMent = exeSQL.execSQL(sql, exeSQL.TYPE_ARRAY);
}

module.exports = Omnipotence;
